package hjj.service;


import model.User;

import dao.impl.UserDAOImpl;

import util.MD5Util;

public class LoginManager {
	public User loginCheck(String username,String password) {
		MD5Util md5=new MD5Util();
		UserDAOImpl userdaoimpl=new UserDAOImpl();
		User user=userdaoimpl.getById(username);
		if(null==user.getUsername()){
			return null;
		}
		String psw=md5.getMD5(password);
		if(psw.equals(user.getPassword())){
			return user;
		}
		return null;
	}
}
